//
//  UIViewController+WSCategory.h
//  WSBaseKit
//
//  Created by zhangcong on 2020/8/14.
//  Copyright © 2020 zhangcong. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <MBProgressHUD.h>

@interface UIViewController (WSCategory)

@property (assign, nonatomic) BOOL forbidPanBack; //需要使用baseNavigationvc
@property (strong,nonatomic) MBProgressHUD * progressHud;

- (void) removeMBProgressHUD;
/**
 *  显示Progress
 *
 *  @param mode 模式
 *  @param msg  显示文本
 */
-(void) showProgress:(MBProgressHUDMode) mode msg:(NSString*) msg;
/**
 *  显示Progress
 *
 *  @param msg 显示文本
 */
-(void) showLoader:(NSString*) msg;
/**
 *  显示 tips 默认显示2秒
 *
 *  @param msg 显示文本
 */
-(void) showTips:(NSString*) msg ;
/**
 *  显示 tips
 *
 *  @param msg   显示文本
 *  @param delay 显示秒数
 */
-(void) showTips:(NSString*) msg afterDelay:(NSTimeInterval)delay;
/**
 *  隐藏Progress
 */
-(void) hiddenProgress;

/**
 *  showError信息  项目需要特殊处理的可以重写
 */
- (void)showError:(NSError *)error;


/// 隐藏键盘
-(void) hideKeyboard;

/**
 push没有使用storyboard的页面
 
 @param identifier <#viewController description#>
 @param block <#block description#>
 */
- (void)pushViewController:(NSString *)identifier block:(void (^)(UIViewController *viewController))block ;

/**
 push使用storyboard的页面
 
 @param identifier <#viewController description#>
  @param storyboardName 不传默认main
 @param block <#block description#>
 */
- (void)pushViewControllerWithIdentifier:(NSString *)identifier storyboardName:(NSString *)storyboardName block:(void (^)(UIViewController *viewController))block ;

-(UIBarButtonItem *)loadLeftItemWithImage:(NSString *)image action:(SEL)action;
-(UIBarButtonItem *)loadRightItemWithImage:(NSString *)image action:(SEL)action;
-(UIBarButtonItem *)loadLeftItemWithTitle:(NSString *)title action:(SEL)action;
-(UIBarButtonItem *)loadRightItemWithTitle:(NSString *)title action:(SEL)action;


@end


